// IFrontend.aidl
package com.fanwj.citrus.aidl;

interface IFrontend {

    @Backing(type="int")
    enum KeyCode {
        AXIS_X = 0,
        AXIS_Y = 1,
        AXIS_Z = 11,
        AXIS_RX = 12,
        AXIS_RY = 13,
        AXIS_RZ = 14,
        AXIS_HAT_X = 15,
        AXIS_HAT_Y = 16,
        AXIS_LTRIGGER = 17,
        AXIS_RTRIGGER = 18,

        KEYCODE_DPAD_UP = 19,
        KEYCODE_DPAD_DOWN = 20,
        KEYCODE_DPAD_LEFT = 21,
        KEYCODE_DPAD_RIGHT = 22,
        KEYCODE_BUTTON_A = 96,
        KEYCODE_BUTTON_B = 97,
        KEYCODE_BUTTON_X = 99,
        KEYCODE_BUTTON_Y = 100,
        KEYCODE_BUTTON_L1 = 102,
        KEYCODE_BUTTON_R1 = 103,
        KEYCODE_BUTTON_L2 = 104,
        KEYCODE_BUTTON_R2 = 105,
        KEYCODE_BUTTON_THUMBL = 106,
        KEYCODE_BUTTON_THUMBR = 107,
        KEYCODE_BUTTON_START = 108,
        KEYCODE_BUTTON_SELECT = 109,
    }

    @Backing(type="int")
    enum SwkbdResult {
        Ok,
        Cancel
    }

    parcelable KeyboardConfig {
        String ok_text;
        String header_text;
        String sub_text;
        String guide_text;
        String initial_text;
        char left_optional_symbol_key;
        char right_optional_symbol_key;
        int max_text_length;
        int min_text_length;
        int initial_cursor_position;
        int type;
        int password_mode;
        int text_draw_type;
        int key_disable_flags;
        boolean use_blur_background;
        boolean enable_backspace_button;
        boolean enable_return_button;
        boolean disable_cancel_button;
    }

    parcelable KeyboardData {
        String text;
        int result;
    }

    int NativeLibrary_startMainLooper();

    boolean NativeLibrary_updateProgress(long max, long progress);

    void NativeLibrary_exitEmulationActivity(int resultCode);
    void NativeLibrary_onEmulationStarted();
    void NativeLibrary_onEmulationStopped(int status);
    void NativeLibrary_onProgramChanged(int programIndex);

    String NativeLibrary_getParentDirectory(String path);
    String NativeLibrary_getFilename(String path);
    long NativeLibrary_getSize(String path);
    boolean NativeLibrary_isDirectory(String path);
    boolean NativeLibrary_exists(String path);
    void NativeLibrary_openContentUri(String uri, String mode, long fdAddr);
    long NativeLibrary_setCurrentThreadName(String name);

    int[] NativeInput_getAxesOfController(String guid);
    int[] NativeInput_getKeysOfController(String guid);
    String[] NativeInput_getPropertyOfControllers();

    KeyboardData SoftwareKeyboard_executeNormal(in KeyboardConfig config);
    void SoftwareKeyboard_executeInline(in KeyboardConfig config);

    void DiskShaderCacheProgress_loadProgress(int stage, int progress, int max);
}